/*
 * Copyright (c) Extreme Vision Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef __TOOL_REPORT_H__
#define __TOOL_REPORT_H__

#include <string>
#include "evdeploy/utils/report/http_client.h"

using namespace std;

namespace ev
{

    class ToolReport
    {
    public:
        explicit ToolReport();
        ~ToolReport();

        /**
         * @brief report tool application with specified url
         * @param[in] url: url for report
         * @param[in] algo_tool_type: report algo tool type, 1:base algo/model, 2:training toolkit, 3:deploy toolkit
         * @param[in] algo_tool_name: report algo tool name
         * @param[in] algo_tool_version: report algo tool version
         * @param[in] remark: report remark info for the algo tool
         * @return int:  -1 report failed, 0 report succeeded
         */
        int report(const string &url, int algo_tool_type, const string &algo_tool_name, const string &algo_tool_version, const string &remark);
        /**
         * @brief report tool application with default url
         * @param[in] algo_tool_type: report algo tool type, 1:base algo/model, 2:training toolkit, 3:deploy toolkit
         * @param[in] algo_tool_name: report algo tool name
         * @param[in] algo_tool_version: report algo tool version
         * @param[in] remark: report remark info for the algo tool
         * @return int:  -1 report failed, 0 report succeeded
         */
        int report(int algo_tool_type, const string &algo_tool_name, const string &algo_tool_version, const string &remark);

    private:
        CHttpClient m_post;
    };

} // end namespace ev
#endif